#include <iostream>
#include <vector>

#include "thread.hpp"

#include <unistd.h>

void run(void)
{
    while (true)
    {
        std::cout << "我是一个线程" << std::endl;
        sleep(1);
    }
}

int main()
{
    std::vector<thread> threads;

    for(int i = 0; i < 10; i++)
    {
        threads.push_back(thread(run));
        threads[i].run();
    }

    for(int i = 0; i < 10; ++i)
        threads[i].join();
    
    return 0;
}